/**
 * Created by yu on 16/9/3.
 */

var util = require('util');

function Parent(){
    this.name = 'father';
    this.age = 50;
    this.say = function(){
        console.log(this.name);
    }
}
Parent.prototype.showName = function(){
    console.log(this.name);
}

function Child(){
    this.name = 'child';
}
//继承
util.inherits(Child,Parent);
var c = new Child();
console.log(c);

c.showName();

/**
 * inspect
 * c:对象
 * depth:深度,显示深度. 0递归一层
 * 将任意一个对象,转成字符串
 *
 */
c.hobby = {
    name:'paly'
}
console.log(util.inspect(c,{depth:0}));

/**
 *
 *
 */
util.isArray();
util.isRegExp();
util.isDate();
util.isError();
